import VueRouter from 'vue-router'

import FindM from '../views/FindM.vue'//绝对路径'@/views/FindM.vue'
import FriendM from '../views/FriendM.vue'
import MyM from '../views/MyM.vue'
import Vue from 'vue'
import NotFind from '@/views/NotFind.vue'
Vue.use(VueRouter)//VueRouter 插件初始化

//创建路由对象
const router =new VueRouter({
  mode:'history',//history 模式 ,地址栏没有# ,需要后台配置访问规则
  //路由规则们routes
  routes:[
    {path:'/',redirect:'/find'},//解决了 网页刚打开出现一片空白的问题 重定向
    {path:'/find',component:FindM},
    {path:'/friend',component:FriendM},
    {path:'/my',component:MyM},
    {path:'*',components:NotFind}
   //404 页面
  ]
})
export default router//导出